// 文件路径：Assets/Editor/AutoSpriteImporter.cs
using UnityEngine;
using UnityEditor;

public class AutoSpriteImporter : AssetPostprocessor
{
    void OnPreprocessTexture()
    {
        // 检查图片是否在指定文件夹中（如路径包含 "/Sprites/"）
        if (assetPath.Contains("/Atlassrc/"))
        {
            TextureImporter importer = (TextureImporter)assetImporter;
            importer.textureType = TextureImporterType.Sprite;
            importer.spritePixelsPerUnit = 100; // 可选：设置默认像素单位
            importer.mipmapEnabled = false;     // 可选：关闭 Mipmap
            importer.spriteImportMode =   SpriteImportMode.Single;
        }
    }
}